package com.zkthink.ceres.file.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;

/**
 * @ClassName ExcelTemplate
 * @Description: 上传文件excel模板
 * @Author ck
 * @Date 2021/1/22
 * @Version V1.0
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_excel_template")
@ApiModel(value = "ExcelTemplate", description = "上传文件模板表")
public class ExcelTemplate extends Entity<Long> {
    private static final long serialVersionUID = 1L;

    /**
     * 模板名称
     */
    @ApiModelProperty(value = "模板名称")
    @Length(max = 255, message = "模板名称长度不能超过255")
    @TableField("template_name")
    private String templateName;


    /**
     * 原始文件名
     */
    @ApiModelProperty(value = "文件id")
    @TableField("file_id")
    private Long fileId;

    /**
     * 原始文件名
     */
    @ApiModelProperty(value = "原始文件名")
    @Length(max = 255, message = "原始文件名长度不能超过255")
    @TableField("submitted_file_name")
    private String submittedFileName;


    /**
     * 是否删除
     * #BooleanStatus{TRUE:1,已删除;FALSE:0,未删除}
     */
    @ApiModelProperty(value = "是否删除")
    @TableField("is_delete")
    private Boolean isDelete;


    /**
     * 文件访问链接
     * 需要通过nginx配置路由，才能访问
     */
    @ApiModelProperty(value = "文件访问链接")
    @Length(max = 255, message = "文件访问链接长度不能超过255")
    @TableField("url")
    private String url;


    @Builder
    public ExcelTemplate(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser,
                         String submittedFileName, Boolean isDelete, String url,
                         String templateName, Long fileId) {
        this.id = id;
        this.createTime = createTime;
        this.createUser = createUser;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.submittedFileName = submittedFileName;
        this.isDelete = isDelete;
        this.url = url;
        this.templateName = templateName;
        this.fileId = fileId;
    }

}
